home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / registry.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  10.9 KB  |  232 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Registry.pas' rev: 3.00
  6.  
  7. #ifndef RegistryHPP
  8. #define RegistryHPP
  9. #include <IniFiles.hpp>
  10. #include <SysUtils.hpp>
  11. #include <Classes.hpp>
  12. #include <Windows.hpp>
  13. #include <SysInit.hpp>
  14. #include <System.hpp>
  15.  
  16. //-- user supplied -----------------------------------------------------------
  17.  
  18. namespace Registry
  19. {
  20. //-- type declarations -------------------------------------------------------
  21. class DELPHICLASS ERegistryException;
  22. class PASCALIMPLEMENTATION ERegistryException : public Sysutils::Exception 
  23. {
  24.     typedef Sysutils::Exception inherited;
  25.     
  26. public:
  27.     /* Exception.Create */ __fastcall ERegistryException(const System::AnsiString Msg) : Sysutils::Exception(
  28.         Msg) { }
  29.     /* Exception.CreateFmt */ __fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec 
  30.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  31.     /* Exception.CreateRes */ __fastcall ERegistryException(int Ident, Extended Dummy) : Sysutils::Exception(
  32.         Ident, Dummy) { }
  33.     /* Exception.CreateResFmt */ __fastcall ERegistryException(int Ident, const System::TVarRec * Args, 
  34.         const int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  35.     /* Exception.CreateHelp */ __fastcall ERegistryException(const System::AnsiString Msg, int AHelpContext
  36.         ) : Sysutils::Exception(Msg, AHelpContext) { }
  37.     /* Exception.CreateFmtHelp */ __fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec 
  38.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  39.         ) { }
  40.     /* Exception.CreateResHelp */ __fastcall ERegistryException(int Ident, int AHelpContext) : Sysutils::
  41.         Exception(Ident, AHelpContext) { }
  42.     /* Exception.CreateResFmtHelp */ __fastcall ERegistryException(int Ident, const System::TVarRec * Args
  43.         , const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
  44.         ) { }
  45.     
  46. public:
  47.     /* TObject.Destroy */ __fastcall virtual ~ERegistryException(void) { }
  48.     
  49. };
  50.  
  51. struct TRegKeyInfo
  52. {
  53.     int NumSubKeys;
  54.     int MaxSubKeyLen;
  55.     int NumValues;
  56.     int MaxValueLen;
  57.     int MaxDataLen;
  58.     _FILETIME FileTime;
  59. } ;
  60.  
  61. enum TRegDataType { rdUnknown, rdString, rdExpandString, rdInteger, rdBinary };
  62.  
  63. struct TRegDataInfo
  64. {
  65.     TRegDataType RegData;
  66.     int DataSize;
  67. } ;
  68.  
  69. class DELPHICLASS TRegistry;
  70. class PASCALIMPLEMENTATION TRegistry : public System::TObject 
  71. {
  72.     typedef System::TObject inherited;
  73.     
  74. private:
  75.     HKEY FCurrentKey;
  76.     HKEY FRootKey;
  77.     bool FLazyWrite;
  78.     System::AnsiString FCurrentPath;
  79.     bool FCloseRootKey;
  80.     void __fastcall SetRootKey(HKEY Value);
  81.     
  82. protected:
  83.     void __fastcall ChangeKey(HKEY Value, const System::AnsiString Path);
  84.     HKEY __fastcall GetBaseKey(bool Relative);
  85.     int __fastcall GetData(const System::AnsiString Name, void * Buffer, int BufSize, TRegDataType &RegData
  86.         );
  87.     HKEY __fastcall GetKey(const System::AnsiString Key);
  88.     void __fastcall PutData(const System::AnsiString Name, void * Buffer, int BufSize, TRegDataType RegData
  89.         );
  90.     void __fastcall SetCurrentKey(HKEY Value);
  91.     
  92. public:
  93.     __fastcall TRegistry(void);
  94.     __fastcall virtual ~TRegistry(void);
  95.     void __fastcall CloseKey(void);
  96.     bool __fastcall CreateKey(const System::AnsiString Key);
  97.     bool __fastcall DeleteKey(const System::AnsiString Key);
  98.     bool __fastcall DeleteValue(const System::AnsiString Name);
  99.     bool __fastcall GetDataInfo(const System::AnsiString ValueName, TRegDataInfo &Value);
  100.     int __fastcall GetDataSize(const System::AnsiString ValueName);
  101.     TRegDataType __fastcall GetDataType(const System::AnsiString ValueName);
  102.     bool __fastcall GetKeyInfo(TRegKeyInfo &Value);
  103.     void __fastcall GetKeyNames(Classes::TStrings* Strings);
  104.     void __fastcall GetValueNames(Classes::TStrings* Strings);
  105.     bool __fastcall HasSubKeys(void);
  106.     bool __fastcall KeyExists(const System::AnsiString Key);
  107.     bool __fastcall LoadKey(const System::AnsiString Key, const System::AnsiString FileName);
  108.     void __fastcall MoveKey(const System::AnsiString OldName, const System::AnsiString NewName, bool Delete
  109.         );
  110.     bool __fastcall OpenKey(const System::AnsiString Key, bool CanCreate);
  111.     System::Currency __fastcall ReadCurrency(const System::AnsiString Name);
  112.     int __fastcall ReadBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);
  113.     bool __fastcall ReadBool(const System::AnsiString Name);
  114.     System::TDateTime __fastcall ReadDate(const System::AnsiString Name);
  115.     System::TDateTime __fastcall ReadDateTime(const System::AnsiString Name);
  116.     double __fastcall ReadFloat(const System::AnsiString Name);
  117.     int __fastcall ReadInteger(const System::AnsiString Name);
  118.     System::AnsiString __fastcall ReadString(const System::AnsiString Name);
  119.     System::TDateTime __fastcall ReadTime(const System::AnsiString Name);
  120.     bool __fastcall RegistryConnect(const System::AnsiString UNCName);
  121.     void __fastcall RenameValue(const System::AnsiString OldName, const System::AnsiString NewName);
  122.     bool __fastcall ReplaceKey(const System::AnsiString Key, const System::AnsiString FileName, const System::AnsiString 
  123.         BackUpFileName);
  124.     bool __fastcall RestoreKey(const System::AnsiString Key, const System::AnsiString FileName);
  125.     bool __fastcall SaveKey(const System::AnsiString Key, const System::AnsiString FileName);
  126.     bool __fastcall UnLoadKey(const System::AnsiString Key);
  127.     bool __fastcall ValueExists(const System::AnsiString Name);
  128.     void __fastcall WriteCurrency(const System::AnsiString Name, System::Currency Value);
  129.     void __fastcall WriteBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);
  130.     void __fastcall WriteBool(const System::AnsiString Name, bool Value);
  131.     void __fastcall WriteDate(const System::AnsiString Name, System::TDateTime Value);
  132.     void __fastcall WriteDateTime(const System::AnsiString Name, System::TDateTime Value);
  133.     void __fastcall WriteFloat(const System::AnsiString Name, double Value);
  134.     void __fastcall WriteInteger(const System::AnsiString Name, int Value);
  135.     void __fastcall WriteString(const System::AnsiString Name, const System::AnsiString Value);
  136.     void __fastcall WriteExpandString(const System::AnsiString Name, const System::AnsiString Value);
  137.     void __fastcall WriteTime(const System::AnsiString Name, System::TDateTime Value);
  138.     __property HKEY CurrentKey = {read=FCurrentKey, nodefault};
  139.     __property System::AnsiString CurrentPath = {read=FCurrentPath};
  140.     __property bool LazyWrite = {read=FLazyWrite, write=FLazyWrite, nodefault};
  141.     __property HKEY RootKey = {read=FRootKey, write=SetRootKey, nodefault};
  142. };
  143.  
  144. class DELPHICLASS TRegIniFile;
  145. class PASCALIMPLEMENTATION TRegIniFile : public Registry::TRegistry 
  146. {
  147.     typedef Registry::TRegistry inherited;
  148.     
  149. private:
  150.     System::AnsiString FFileName;
  151.     
  152. public:
  153.     __fastcall TRegIniFile(const System::AnsiString FileName);
  154.     HIDESBASE System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString 
  155.         Ident, const System::AnsiString Default);
  156.     HIDESBASE int __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident
  157.         , int Default);
  158.     HIDESBASE void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident
  159.         , int Value);
  160.     HIDESBASE void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident
  161.         , const System::AnsiString Value);
  162.     HIDESBASE bool __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident
  163.         , bool Default);
  164.     HIDESBASE void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident
  165.         , bool Value);
  166.     void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings* Strings);
  167.     void __fastcall ReadSections(Classes::TStrings* Strings);
  168.     void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings* Strings);
  169.     void __fastcall EraseSection(const System::AnsiString Section);
  170.     HIDESBASE void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident
  171.         );
  172.     __property System::AnsiString FileName = {read=FFileName};
  173. public:
  174.     /* TRegistry.Destroy */ __fastcall virtual ~TRegIniFile(void) { }
  175.     
  176. };
  177.  
  178. class DELPHICLASS TRegistryIniFile;
  179. class PASCALIMPLEMENTATION TRegistryIniFile : public Inifiles::TCustomIniFile 
  180. {
  181.     typedef Inifiles::TCustomIniFile inherited;
  182.     
  183. private:
  184.     TRegIniFile* FRegIniFile;
  185.     
  186. public:
  187.     __fastcall TRegistryIniFile(const System::AnsiString FileName);
  188.     __fastcall virtual ~TRegistryIniFile(void);
  189.     virtual System::TDateTime __fastcall ReadDate(const System::AnsiString Section, const System::AnsiString 
  190.         Name, System::TDateTime Default);
  191.     virtual System::TDateTime __fastcall ReadDateTime(const System::AnsiString Section, const System::AnsiString 
  192.         Name, System::TDateTime Default);
  193.     virtual int __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident
  194.         , int Default);
  195.     virtual double __fastcall ReadFloat(const System::AnsiString Section, const System::AnsiString Name
  196.         , double Default);
  197.     virtual System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString 
  198.         Ident, const System::AnsiString Default);
  199.     virtual System::TDateTime __fastcall ReadTime(const System::AnsiString Section, const System::AnsiString 
  200.         Name, System::TDateTime Default);
  201.     virtual void __fastcall WriteDate(const System::AnsiString Section, const System::AnsiString Name, 
  202.         System::TDateTime Value);
  203.     virtual void __fastcall WriteDateTime(const System::AnsiString Section, const System::AnsiString Name
  204.         , System::TDateTime Value);
  205.     virtual void __fastcall WriteFloat(const System::AnsiString Section, const System::AnsiString Name, 
  206.         double Value);
  207.     virtual void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident
  208.         , int Value);
  209.     virtual void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident
  210.         , const System::AnsiString Value);
  211.     virtual void __fastcall WriteTime(const System::AnsiString Section, const System::AnsiString Name, 
  212.         System::TDateTime Value);
  213.     virtual void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings* Strings);
  214.     virtual void __fastcall ReadSections(Classes::TStrings* Strings);
  215.     virtual void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings* Strings
  216.         );
  217.     virtual void __fastcall EraseSection(const System::AnsiString Section);
  218.     virtual void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident)
  219.         ;
  220.     virtual void __fastcall UpdateFile(void);
  221.     __property TRegIniFile* RegIniFile = {read=FRegIniFile};
  222. };
  223.  
  224. //-- var, const, procedure ---------------------------------------------------
  225.  
  226. }    /* namespace Registry */
  227. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  228. using namespace Registry;
  229. #endif
  230. //-- end unit ----------------------------------------------------------------
  231. #endif    // Registry
  232.